package com.xcm.sso.client.config;

import com.xcm.sso.client.filter.SSOLoginFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;

@Configuration
public class FilterConfig {
	@Bean
	public CustomProperties customProperties() {
		return new CustomProperties();
	}
	/**
	 * 配置过滤器
	 */
	@Bean
	@Order(1)
	public FilterRegistrationBean someFilterRegistration() {
		FilterRegistrationBean registration = new FilterRegistrationBean();
		registration.setFilter(new SSOLoginFilter());
		registration.addUrlPatterns("/*");
		registration.setName("SSOLoginFilter");
		return registration;
	}

}
